package com.chapter12.try_catch;

import java.util.Scanner;
@SuppressWarnings({"all"})
public class exercise_exception {
    public static void main(String[] args) {
        ExceptionExample exceptionExample = new ExceptionExample();
        exceptionExample.methodRecursion();
    }
}

@SuppressWarnings({"all"})
class ExceptionExample {
    public void methodRecursion() {
        try{
            System.out.println("Enter an integer");
            Scanner scanner = new Scanner(System.in);
            int number = scanner.nextInt();
        } catch (Exception e) {
            methodRecursion();
        } finally {
            return;
        }
    }
}



